import 'package:flutter/material.dart';
import 'package:flutter_screenutil/src/size_extension.dart';
import 'package:get/get_core/src/get_main.dart';
import 'package:get/get_navigation/src/extension_navigation.dart';

import '../r.dart';
import '../utils/utils.dart';
import '../values/MyColors.dart';

/**
 * @Description: 空页面
 * @Author: 下雨了
 * @CreateDate: 2022-05-27 14:27
 * @UpdateUser: 更新者
 * @UpdateDate:  2022-05-27 14:27
 * @UpdateRemark: 更新说明
 * @Version: 1.0
 */

///
class EmptyView extends StatelessWidget {
  final double? top;
  final Orientation? orientation;

  const EmptyView({
    Key? key,
    this.orientation,
    this.top,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Column(
      mainAxisAlignment: MainAxisAlignment.center,
      crossAxisAlignment: CrossAxisAlignment.center,
      children: [
        // LottieBuilder.network(
        //   'https://assets1.lottiefiles.com/packages/lf20_MrIjH2.json',
        //   width: Get.width - 2 * gap12,
        //   fit: BoxFit.contain,
        // ),
        Container(height: top ?? Get.height * 0.05),
        Image.asset(R.assetsImgBg4,
            width: isPad(context) ? (orientation == Orientation.portrait ? Get.width / 6 : Get.width / 12) : Get.width / 2.5, fit: BoxFit.fitWidth),
        SizedBox(height: 10.r),
        Text('暂无数据', style: TextStyle(color: MyColors.FF666666, fontSize: 13.r)),
        Container(constraints: BoxConstraints(minHeight: top ?? Get.height * 0.1))
      ],
    );
  }
}
